package com.party.common;

//import com.party.service.InvestService;
//import com.party.service.MessageService;


/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: 13-3-25
 * Time: 下午11:37
 * To change this template use File | Settings | File Templates.
 */
public class InvestCheck {
//    @Resource
//    InvestService investService;
//    @Resource
//    MessageService messageService;
//
//    public void work() {
//        System.out.println(">>>>>>>>>>>>投资逾期检查>>>>>>>>>>>>");
//
//        List<AkBuyInfo> akBuyInfos = investService.getCheckInvestLists();
//        String time1 = "";
//        int num = 0;
//        if (akBuyInfos.size() > 0) {
//            for (AkBuyInfo akBuyInfo : akBuyInfos) {
//
//                time1 = Tools.getDate(akBuyInfo.getRepaytime(), 1, 1).substring(0, 10) + " 00:00:00";
//                int days = (Tools.getDiffDay(Tools.getNowDate(), time1)).intValue();
//                double overMoney = 0;
//                if (days <= 0) {
//
//                    int status = investService.investHuiGou(akBuyInfo);
//                    if (status == -1) {  //没钱付
//                        akBuyInfo.setStatus("2");    //逾期
//                        investService.update(akBuyInfo);
//                    }
//
//                    AkSysMsg akSysMsg = new AkSysMsg();
//                    akSysMsg.setTitle("投资逾期提醒");
//                    akSysMsg.setContent("你有一笔投资逾期!");
//                    akSysMsg.setTouid(akBuyInfo.getUid());
//                    akSysMsg.setFromuid(0);
//                    akSysMsg.setSendtime(Tools.getNowDate());
//                    messageService.sendSysMsg(akSysMsg);
//                    num++;
//                }
//            }
//        }
//        System.out.println("投资存在逾期数：（" + num + "）!");
//    }
}
